type ProjRef[O,P] native

method ProjRef.f Lambda[Maybe[P],Pair[O,P]] native('__ProjRef_f')

public method
    ProjRef.Value P {
        let (_,proj) = this.f(None),
        proj
    }

public method
    ProjRef.Update Lambda[P,O] {
        { (proj) => {
            let (obj,_) = this.f(proj),
            obj
        } }
    }


type CaseRef[O,C] native

method CaseRef.f Lambda[Maybe[C],Pair[O,Maybe[C]]] native('__CaseRef_f')

public method
    CaseRef.Value Maybe[C] {
        let (_,case?) = this.f(None),
        case?
    }

public method
    CaseRef.Update Lambda[C,O] {
        { (case) => {
            let (obj,_) = this.f(case),
            obj
        } }
    }


